import request from '@/common/request.js'
import { formatGetUri } from '@/common/util.js'

const api = {};
const HOME = 'home';
const GOODS = 'goods';
const PRODUCT ='products';
const ARTICLE ='article';
const TURN = 'turn';
// 首页结构
api.homeindex = params => request.globalRequest(`${HOME}/index`, 'POST', params, 1)
//商品分类
api.goodsCategory = params => request.globalRequest(`${GOODS}/category`, 'POST', params, 1)
//产品列表
api.productlist = params => request.globalRequest(`${PRODUCT}/list`, 'POST', params, 1)
//商品分类
api.categoryHaodanke = params => request.globalRequest(`${GOODS}/categoryHaodanke`, 'POST', params, 1)
//获取首页商品分类
api.categoryHaodanke_index = params => request.globalRequest(`${GOODS}/categoryHaodanke_index`, 'POST', params, 1)
//商品列表
api.goods_list = params => request.globalRequest(`${GOODS}/goods_list`, 'POST', params, 1)
//获取发圈栏目列表
api.article_cate = params => request.globalRequest(`${ARTICLE}/article_cate`, 'POST', params, 1)
//获取发圈列表
api.faquan = params => request.globalRequest(`${GOODS}/faquan`, 'POST', params, 1)
//抖音分类
api.home_douyinCategory = params => request.globalRequest(`${GOODS}/Home_douyinCategory`, 'POST', params, 1)
//抖音列表
api.home_douyin = params => request.globalRequest(`${GOODS}/home_douyin`, 'POST', params, 1)

//商品详情
api.goodsdetail = params => request.globalRequest(`${GOODS}/goods_detail`, 'POST', params, 1)

//淘宝转链
api.goods_turn = params => request.globalRequest(`${TURN}/goods_turn`, 'POST', params, 1)
//转淘口令
api.taoword = params => request.globalRequest(`${TURN}/taoword`, 'POST', params, 1)
//文章分类
api.article_category = params => request.globalRequest(`${ARTICLE}/article_category`, 'POST', params, 1)
//文章列表
api.article_list = params => request.globalRequest(`${ARTICLE}/article_list`, 'POST', params, 1)
//热搜关键字
api.home_hot_key = params => request.globalRequest(`${GOODS}/home_hot_key`, 'POST', params, 1)
//联想关键词
api.search_suggestion = params => request.globalRequest(`${GOODS}/search_suggestion`, 'POST', params, 1)
//商品搜索
api.goods_search = params => request.globalRequest(`${GOODS}/goods_search`, 'POST', params, 1)
//相关推荐
api.related_suggest = params => request.globalRequest(`${GOODS}/related_suggest`, 'POST', params, 1)
//品牌列表
api.brand_list = params => request.globalRequest(`${GOODS}/brand_list`, 'POST', params, 1)
//品牌详情列表
api.brand_detail = params => request.globalRequest(`${GOODS}/brand_detail`, 'POST', params, 1)
//快枪商品 秒杀
api.fastbuy = params => request.globalRequest(`${GOODS}/fastbuy`, 'POST', params, 1)
//达人说说分类
api.talentcate = params => request.globalRequest(`${PRODUCT}/talentcate`, 'POST', params, 1)
//达人说说列表
api.talent = params => request.globalRequest(`${PRODUCT}/talent`, 'POST', params, 1)
//达人说说列表
api.talentArticle = params => request.globalRequest(`${PRODUCT}/talentArticle`, 'POST', params, 1)
//聚划算
api.home_free_ship = params => request.globalRequest(`${GOODS}/home_free_ship`, 'POST', params, 1)
//超级返菜单
api.super_menu = params => request.globalRequest(`${GOODS}/super_menu`, 'POST', params, 1)
//超级返列表
api.super_fan = params => request.globalRequest(`${GOODS}/super_fan`, 'POST', params, 1)
//解析淘口令
api.openshangpin = params => request.globalRequest(`${GOODS}/openshangpin`, 'POST', params, 1)
//弹窗广告
api.home_tan_ad = params => request.globalRequest(`${HOME}/home_tan_ad`, 'POST', params, 1)



// GET请求方式
//api.homeindex = params => request.globalRequest(`${PORT1}/index${formatGetUri(params)}`, 'GET',{}, 1)
export default api